<!DOCTYPE html>
<html lang="en">
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>博客详情</title>
    <!-- 引入 layui.css -->
    <link rel="stylesheet" href="../layui/css/layui.css">
<!--    <link rel="stylesheet" href="../css/Main.css">-->
    <link rel="stylesheet" href="../css/head.css">
    <link rel="stylesheet" href="../css/detail.css">
    <script src="../js/showdown.min.js"></script>
</head>
<body bgcolor="#d2d2d2">
<!--    导航条-->
<div th:replace="~{head :: navigation-bar}"></div>
<div class="bolg-detail">
    <!--                {{blog.title}}-->
    <h4 class="title" th:text="${blogVo.title}"></h4>

    <div class="content">[[${blogVo.content}]]</div>
    <!--                layui-icon-use-->
    <span class="creatDate" th:text="${#dates.format(blogVo.creatDate, 'yyyy-MM-dd')}"></span>
</div>
<div class="presentation">
    <div id="picture">
        <img id="bg" src="../picture/background.jpg" >
        <img id="header" src="../picture/header.jpg" >
    </div>
    <div id="introduce">
    <p class="Name" th:text="${blogVo.userName}"></p>
    <p> 一个95后菜鸟，加油！</p>

    </div>

</div>
<script type="module">
    window.onload =
        function f() {
            let converter = new showdown.Converter();
            let x = document.getElementsByClassName("content").valueOf();
            for (let i = 0; i < x.length; i++) {
                console.log(x[i].innerHTML);
                    // let y = String.toString("");
                let html = converter.makeHtml(x[i].innerHTML);
                console.log(html)
                x[i].innerHTML = html;
            }
        }
</script>
</body>
</html>